%Funcion gDer
function ans = gDer(method, x, beta)
    switch(method)
	case {1,4}
	    ans = 1;
	case 2
	    ans = beta*(1-(g(method, x, beta)).^2);
	case 3
	    ans = 2*beta.*g(method, x, beta).*(1-g(method, x, beta));
    endswitch
endfunction
